import java.util.*;

public class book {
    public static void main(String[] args) {

        Set<Integer> set = new TreeSet<>();
        Set<Integer> set1 = new TreeSet<>();
        set1.add(1);
        set1.add(2);
        set.add(1);

        set.add(2);
        set.add(3);
        Object[] a = set.toArray();
        System.out.println(Arrays.toString(a));

        Integer[] arr = new Integer[0];
        Integer[] arr1 = new Integer[0];
        arr = set.toArray(arr);
        Integer[] integers = {1,2};
        System.out.println("ss");
        System.out.println(set.removeAll(set1));
        arr1 = set.toArray(arr1);
        System.out.println(Arrays.toString(arr1));
        System.out.println("ss");
//        set.addAll()
        System.out.println(set.containsAll(set1));
        System.out.println(set.equals(set1));

    }
    public static void main1(String[] args) {
        Map<Integer, String> map = new TreeMap<>();
        //插入
        map.put(1, "11");
        map.put(2, "22");
        map.keySet();

        map.values();
//        map.merge();
        //查找 boolean
        System.out.println(map.containsKey(1));//true
        System.out.println(map.containsKey(3));//false
        //根据key 返回对应的value
        System.out.println(map.get(1));//"11"
        //删除
        System.out.println(map.toString());
//        System.out.println(map.remove(10));
        System.out.println(map.replace(1, "www"));
        System.out.println(map.toString());
        System.out.println(map.replace(1, "www","wwww"));
        System.out.println(map.toString());
        map.notify();
    }
}
